<script setup>
import {
  Setting,
    UserFilled,
    Shop,Document,House,
  Menu as IconMenu,
} from '@element-plus/icons-vue'

import {useRouter,useRoute} from "vue-router"
const router = useRouter()
const route = useRoute()
const handleOpen = (key, keyPath) => {
    console.log(router.getRoutes())
    console.log(key)

}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}

</script>

<template>
  <el-menu
      default-active="/admin/home"
      active-text-color="#ffd04b"
      class="el-menu-vertical-demo"
      style="height: 100vh; overflow-y: auto;"
      background-color="#545c64"
      text-color="#fff"
      @open="handleOpen"
      @close="handleClose"
      router

  >
    <el-menu-item index="/admin/home">
      <el-icon><House /></el-icon>
      <span>首页</span>
    </el-menu-item>
    <el-menu-item index="/admin/brand">
      <el-icon><icon-menu /></el-icon>
      <span>品牌管理</span>
    </el-menu-item>
    <el-menu-item index="/admin/user">
      <el-icon><UserFilled /></el-icon>
      <span>用户管理</span>
    </el-menu-item>
    <el-sub-menu :index="null"   >
      <template #title>
        <el-icon><setting /></el-icon>
        <span>车辆管理</span>
      </template>
      <el-menu-item index="/admin/vehicle">车型信息管理</el-menu-item>
      <el-menu-item index="/admin/car">车辆数据管理</el-menu-item>
    </el-sub-menu>
    <el-sub-menu :index="null"   >
      <template #title>
        <el-icon><Shop /></el-icon>
        <span>租赁管理</span>
      </template>
      <el-menu-item index="/admin/goods">租赁信息管理</el-menu-item>
      <el-menu-item index="/admin/order">车辆租赁订单</el-menu-item>
    </el-sub-menu>
    <el-menu-item index="/admin/returnCar">
      <el-icon><Document /></el-icon>
      <span>还车信息管理</span>
    </el-menu-item>

  </el-menu>

</template>

<style scoped>


</style>
